import Isme from "./isme.js"


import store from "../../store/store";
import {Router,Route,hashHistory,IndexRedirect} from "react-router";

export default React.createClass({ 
	componentWillMount:function(){
		//第一次打开页面,如果没有获取到登录状态,瞬间跳转到登录页面
		if(sessionStorage.getItem("ZT")==null){
			setTimeout(function(){
				hashHistory.push("sign")
			},300)
		}else{
			//获取url中的登录名字
			//console.log(sessionStorage.getItem("ZT"))
			var username = JSON.parse(sessionStorage.getItem("ZT")) 
			this.setState({
				username : username.user 
			})
		}
	},
	getInitialState:function(){
		return { 
				 username :""
			}
	},
	render :function(){
		
		return  (
			<Isme data = {this.state.username}/>
			
		)
	}
})
